(function ($, window, document) {

var oList = {
	oContainer: null,
	oSearch: null,
	oDrag: null,

	init: function () {
		this.initState();
		this.initEvent();
	},
	initState: function () {
		this.oContainer = $('.list-container');
		this.oSearch = this.oContainer.find('.search-box');
		this.oDrag = this.oContainer.find('.drag-box');
		this.oDragIcon = this.oDrag.find('.fold-btn i');
	},
	initEvent: function () {
		var _this = this;
		this.oDrag.find('.fold-btn').on('click', function () {
			// 搜索盒子
			_this.oSearch.animate({
				width: _this.oSearch.isHide ? 280 : 0
			}, 300);
			// 折叠图标
			_this.oDragIcon.css({
				transform: 'rotate(' + (_this.oSearch.isHide ? 0 : 180) + 'deg)'
			})
			// 控制参数
			_this.oSearch.isHide = !_this.oSearch.isHide;
		})
	}
}

$(function () {
	oList.init();
})

})($, window, document);